class SweetPotatoes(object):
    total_time = 0
    dressings = []
    status = ''

    def cook(self, time):
        self.total_time = time + self.total_time

        if self.total_time == 0:
            self.status = '生瓜蛋子'
        elif 0 < self.total_time <= 4:
            self.status = '刚有一点熟'
        elif 4 < self.total_time <= 8:
            self.status = '烤的差不多了'
        elif 8 < self.total_time < 12:
            self.status = '可以食用了，烤的不错'
        elif 12 < self.total_time <= 16:
            self.status = '烤糊了,下次努力吧'
        elif self.total_time > 16:
            self.status = '已经碳化了,以后别烤地瓜了,你没天赋'

    def addDressing(self, dressing):
        self.dressings.append(dressing)

    def __str__(self):
        if len(self.dressings) == 0:
            return self.status
        else:
            return self.status + '\n添加的调味品有\n' + str(self.dressings)


sp1 = SweetPotatoes()
sp1.cook(4)
sp1.addDressing('孜然')
print(sp1)
sp1.cook(6)
sp1.addDressing('辣椒面')
print(sp1)
sp1.cook(3)
sp1.addDressing('盐')
print(sp1)
sp1.cook(10)
print(sp1)
